package tech.jhipster.lite.shared.slug.domain;

import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import tech.jhipster.lite.module.domain.resource.JHipsterModuleSlugFactory;

public enum JHLiteModuleSlug implements JHipsterModuleSlugFactory {
  ANGULAR_CORE("angular-core"),
  ANGULAR_HEALTH("angular-health"),
  ANGULAR_JWT("angular-jwt"),
  ANGULAR_OAUTH_2("angular-oauth2"),
  APPLICATION_SERVICE_HEXAGONAL_ARCHITECTURE_DOCUMENTATION("application-service-hexagonal-architecture-documentation"),
  APPROVAL_TESTS("approval-tests"),
  CAFFEINE_CACHE("caffeine-cache"),
  CASSANDRA("cassandra"),
  CASSANDRA_MIGRATION("cassandra-migration"),
  CHECKSTYLE("checkstyle"),
  CONSUL("consul"),
  CUSTOM_JHLITE("custom-jhlite"),
  CYPRESS_COMPONENT_TESTS("cypress-component-tests"),
  CYPRESS_E2E("cypress-e2e"),
  DATASOURCE_MARIADB("datasource-mariadb"),
  DATASOURCE_MSSQL("datasource-mssql"),
  DATASOURCE_MYSQL("datasource-mysql"),
  DATASOURCE_POSTGRESQL("datasource-postgresql"),
  DOCKERFILE_MAVEN("dockerfile-maven"),
  DOCKERFILE_GRADLE("dockerfile-gradle"),
  EHCACHE_JAVA_CONFIG("ehcache-java-config"),
  EHCACHE_XML_CONFIG("ehcache-xml-config"),
  EUREKA_CLIENT("eureka-client"),
  FLYWAY("flyway"),
  FLYWAY_MARIADB("flyway-mariadb"),
  FLYWAY_MSSQL("flyway-mssql"),
  FLYWAY_MYSQL("flyway-mysql"),
  FLYWAY_POSTGRESQL("flyway-postgresql"),
  FRONTEND_MAVEN_PLUGIN("frontend-maven-plugin"),
  FRONTEND_MAVEN_PLUGIN_CACHE("frontend-maven-plugin-cache"),
  FRONT_HEXAGONAL_ARCHITECTURE("front-hexagonal-architecture"),
  NODE_GRADLE_PLUGIN("node-gradle-plugin"),
  GATEWAY("gateway"),
  GIT_INFORMATION("git-information"),
  GITHUB_ACTIONS_MAVEN("github-actions-maven"),
  GITHUB_ACTIONS_GRADLE("github-actions-gradle"),
  GITHUB_CODESPACES("github-codespaces"),
  GITLAB_CI_MAVEN("gitlab-ci-maven"),
  GITLAB_CI_GRADLE("gitlab-ci-gradle"),
  RENOVATE("renovate"),
  GITPOD("gitpod"),
  GRADLE_JAVA("gradle-java"),
  GRADLE_WRAPPER("gradle-wrapper"),
  HIBERNATE_2ND_LEVEL_CACHE("hibernate-2nd-level-cache"),
  INFINITEST_FILTERS("infinitest-filters"),
  INIT("init"),
  INTERNATIONALIZED_ERRORS("internationalized-errors"),
  JACOCO("jacoco"),
  JACOCO_WITH_MIN_COVERAGE_CHECK("jacoco-with-min-coverage-check"),
  JAVA_ARCHUNIT("java-archunit"),
  JAVA_BASE("java-base"),
  JAVA_ENUMS("java-enums"),
  JAVA_MEMOIZERS("java-memoizers"),
  JIB("jib"),
  JMOLECULES("jmolecules"),
  JOOQ_MARIADB("jooq-mariadb"),
  JOOQ_MSSQL("jooq-mssql"),
  JOOQ_MYSQL("jooq-mysql"),
  JOOQ_POSTGRESQL("jooq-postgresql"),
  JPA_PAGINATION("jpa-pagination"),
  JPA_MARIADB("jpa-mariadb"),
  JPA_MSSQL("jpa-mssql"),
  JPA_MYSQL("jpa-mysql"),
  JPA_POSTGRESQL("jpa-postgresql"),
  JQASSISTANT("jqassistant"),
  JQASSISTANT_JMOLECULES("jqassistant-jmolecules"),
  JQASSISTANT_SPRING("jqassistant-spring"),
  JQWIK("jqwik"),
  KIPE_AUTHORIZATION("kipe-authorization"),
  KIPE_EXPRESSION("kipe-expression"),
  LICENSE_APACHE("license-apache"),
  LICENSE_MIT("license-mit"),
  LIQUIBASE("liquibase"),
  LIQUIBASE_ASYNC("liquibase-async"),
  LIQUIBASE_LINTER("liquibase-linter"),
  LOGSTASH("logstash"),
  LOGS_SPY("logs-spy"),
  MAVEN_JAVA("maven-java"),
  MAVEN_WRAPPER("maven-wrapper"),
  MODERNIZER("modernizer"),
  MONGOCK("mongock"),
  MONGODB("mongodb"),
  NEO4J("neo4j"),
  NEO4J_MIGRATIONS("neo4j-migrations"),
  OPENAPI_CONTRACT("openapi-contract"),
  OPENAPI_BACKWARDS_COMPATIBILITY_CHECK("openapi-backwards-compatibility-check"),
  OPTIONAL_TYPESCRIPT("optional-typescript"),
  PAGINATION_DOMAIN("pagination-domain"),
  PLAYWRIGHT_COMPONENT_TESTS("playwright-component-tests"),
  PLAYWRIGHT_E2E("playwright-e2e"),
  PRETTIER("prettier"),
  PROTOBUF("protobuf"),
  PROTOBUF_BACKWARDS_COMPATIBILITY_CHECK("protobuf-backwards-compatibility-check"),
  REACT_CORE("react-core"),
  REACT_I18N("react-i18next"),
  REACT_JWT("react-jwt"),
  REDIS("redis"),
  REST_PAGINATION("rest-pagination"),
  SAMPLE_CASSANDRA_PERSISTENCE("sample-cassandra-persistence"),
  SAMPLE_FEATURE("sample-feature"),
  SAMPLE_JPA_PERSISTENCE("sample-jpa-persistence"),
  SAMPLE_LIQUIBASE_CHANGELOG("sample-liquibase-changelog"),
  SAMPLE_MONGODB_PERSISTENCE("sample-mongodb-persistence"),
  SAMPLE_NOT_POSTGRESQL_FLYWAY_CHANGELOG("sample-not-postgresql-flyway-changelog"),
  SAMPLE_POSTGRESQL_FLYWAY_CHANGELOG("sample-postgresql-flyway-changelog"),
  SONAR_QUBE_JAVA_BACKEND("sonar-qube-java-backend"),
  SONAR_QUBE_JAVA_BACKEND_AND_FRONTEND("sonar-qube-java-backend-and-frontend"),
  SPRING_BOOT("spring-boot"),
  SPRING_BOOT_ACTUATOR("spring-boot-actuator"),
  SPRING_BOOT_ASYNC("spring-boot-async"),
  SPRING_BOOT_CACHE("spring-boot-cache"),
  SPRING_BOOT_CUCUMBER_MVC("spring-boot-cucumber-mvc"),
  SPRING_BOOT_CUCUMBER_WEBFLUX("spring-boot-cucumber-webflux"),
  SPRING_BOOT_CUCUMBER_JPA_RESET("spring-boot-cucumber-jpa-reset"),
  SPRING_BOOT_CUCUMBER_JWT_AUTHENTICATION("spring-boot-cucumber-jwt-authentication"),
  SPRING_BOOT_CUCUMBER_OAUTH_2_AUTHENTICATION("spring-boot-cucumber-oauth2-authentication"),
  SPRING_BOOT_DEVTOOLS("spring-boot-devtools"),
  SPRING_BOOT_LOCAL_PROFILE("spring-boot-local-profile"),
  SPRING_BOOT_JWT("spring-boot-jwt"),
  SPRING_BOOT_JWT_BASIC_AUTH("spring-boot-jwt-basic-auth"),
  SPRING_BOOT_KAFKA("spring-boot-kafka"),
  SPRING_BOOT_KAFKA_AKHQ("spring-boot-kafka-akhq"),
  SPRING_BOOT_KAFKA_SAMPLE_PRODUCER_CONSUMER("spring-boot-kafka-sample-producer-consumer"),
  SPRING_BOOT_OAUTH_2("spring-boot-oauth2"),
  SPRING_BOOT_OAUTH_2_ACCOUNT("spring-boot-oauth2-account"),
  SPRING_BOOT_OAUTH_2_AUTH_0("spring-boot-oauth2-auth0"),
  SPRING_BOOT_OAUTH_2_OKTA("spring-boot-oauth2-okta"),
  SPRING_BOOT_PULSAR("spring-boot-pulsar"),
  SPRING_BOOT_MVC_EMPTY("spring-boot-mvc-empty"),
  SPRING_BOOT_THYMELEAF("spring-boot-thymeleaf"),
  THYMELEAF_TEMPLATE("thymeleaf-template"),
  THYMELEAF_TEMPLATE_HTMX_WEBJAR("thymeleaf-template-htmx-webjars"),
  THYMELEAF_TEMPLATE_ALPINEJS_WEBJAR("thymeleaf-template-alpinejs-webjars"),
  THYMELEAF_TEMPLATE_TAILWINDCSS("thymeleaf-template-tailwindcss"),
  SPRING_BOOT_TOMCAT("spring-boot-tomcat"),
  SPRING_BOOT_UNDERTOW("spring-boot-undertow"),
  SPRING_BOOT_WEBFLUX_EMPTY("spring-boot-webflux-empty"),
  SPRING_BOOT_WEBFLUX_NETTY("spring-boot-webflux-netty"),
  SPRING_CLOUD("spring-cloud"),
  SPRINGDOC_JWT("springdoc-jwt"),
  SPRINGDOC_MVC_OPENAPI("springdoc-mvc-openapi"),
  SPRINGDOC_OAUTH_2("springdoc-oauth2"),
  SPRINGDOC_OAUTH_2_AUTH_0("springdoc-oauth2-auth0"),
  SPRINGDOC_OAUTH_2_OKTA("springdoc-oauth2-okta"),
  SPRINGDOC_WEBFLUX_OPENAPI("springdoc-webflux-openapi"),
  TIKUI("tikui"),
  TS_LOADER("ts-loader"),
  WEBJARS_LOCATOR("webjars-locator"),
  HTMX_WEBJARS("htmx-webjars"),
  ALPINE_JS_WEBJARS("alpinejs-webjars"),
  SVELTE_CORE("svelte-core"),
  TYPESCRIPT("typescript"),
  VUE_CORE("vue-core"),
  VUE_I18N("vue-i18next"),
  VUE_JWT("vue-jwt"),
  VUE_OAUTH2_KEYCLOAK("vue-oauth2-keycloak"),
  VUE_PINIA("vue-pinia"),
  TS_PAGINATION_DOMAIN("ts-pagination-domain"),
  TS_REST_PAGINATION("ts-rest-pagination"),
  LANGCHAIN4J("langchain4j"),
  SPRING_BOOT_LANGCHAIN4J_SAMPLE("spring-boot-langchain4j-sample");

  private static final Map<String, JHLiteModuleSlug> moduleSlugMap = Stream.of(values()).collect(
    Collectors.toMap(JHLiteModuleSlug::get, Function.identity())
  );
  private final String slug;

  JHLiteModuleSlug(String slug) {
    this.slug = slug;
  }

  @Override
  public String get() {
    return slug;
  }

  public static Optional<JHLiteModuleSlug> fromString(String slug) {
    return Optional.ofNullable(moduleSlugMap.get(slug));
  }
}
